package com.wbl.tijianssm.controller;



import com.wbl.tijianssm.pojo.Users;
import com.wbl.tijianssm.response.ApiRestResponse;
import com.wbl.tijianssm.service.UsersService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
public class commonController {

    @Autowired
    UsersService usersService;

    @ResponseBody
    @PostMapping("/login")
    public ApiRestResponse login(@RequestBody Users users){
        return usersService.login(users);
    }

    @ResponseBody
    @PutMapping("/register")
    public ApiRestResponse register(@RequestBody Users users){
        return usersService.register(users);
    }
}
